<template>

  <div class="product-add">
    <!--form表单-->
    <el-form size="small" ref="form" :model="form" label-width="80px">
    
      <div class="common-form">添加</div>

      <el-form-item label="备注" prop="title" :rules="[{required: true,message: ' '}]">
        <el-input v-model="form.title" placeholder="请输入备注" class="max-w460"></el-input>
      </el-form-item>
  
     

      <!--提交-->
      <div class="common-button-wrapper">
        <el-button size="small" type="info" @click="cancelFunc">取消</el-button>
        <el-button size="small" type="primary" @click="onSubmit" :loading="loading">提交</el-button>
      </div>
    </el-form>
   
  </div>
</template>

<script>

  import StoreApi from '@/api/store.js';
  import DataApi from '@/api/data.js';
  import Upload from '@/components/file/Upload';
  export default {
    components: {
      Upload
    },
    data() {
      return {
    
        /*form表单数据*/
        form: {
          title:'',
        },
      
      };
    },
    created() {
      this.getData();
    },

    methods: {
 

      /*添加用户*/
      onSubmit() {
        let self = this;
        let form = self.form;
        self.$refs.form.validate((valid) => {
          if (valid) {
            self.loading = true;
            StoreApi.addremarks(form, true)
              .then(data => {
                self.loading = false;
                if (data.code == 1) {
                  self.$message({
                    message: '恭喜你，添加成功',
                    type: 'success'
                  });
                  self.$router.push('/store/remarks/index');
                } else {
                  self.loading = false;
                }
              })
              .catch(error => {
                self.loading = false;
              });
          }
        });
      },
  

    }

  };
</script>

<style lang="scss" scoped>
  .basic-setting-content {}

  .product-add {
    padding-bottom: 50px;
  }

  .img {
    margin-top: 10px;
  }
</style>
<style lang="scss">
.dialog-footer-at-remark-map{
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 30px;
}
</style>
